//
//  JOAppCell.m
//  app管理
//
//  Created by song on 15/1/19.
//  Copyright (c) 2015年 song. All rights reserved.
//

#import "JOAppCell.h"

@interface JOAppCell()
@property (weak, nonatomic) IBOutlet UIImageView *iconview;
@property (weak, nonatomic) IBOutlet UILabel *nameview;
@property (weak, nonatomic) IBOutlet UILabel *introview;
- (IBAction)downclick:(id)sender;

@property (weak, nonatomic) IBOutlet UIButton *downbtn;

@end

@implementation JOAppCell


-(void)setApp:(JOApp *)app
{
    _app =app;
    
    self.iconview.image =[UIImage imageNamed:app.icon];
    self.nameview.text =app.name;
    self.introview.text =[NSString stringWithFormat:@"大小:%@|下载量 :%@",app.size,app.download];
    
    self.downbtn.enabled = (self.app.downloaded ==NO);
}

- (IBAction)downclick:(id)sender {
    
    self.app.downloaded =YES;
    self.downbtn.enabled =NO;
}
@end
